import {Observable} from 'rxjs';
import {Injectable} from '@angular/core';
import {HttpService} from '../../httpService';


@Injectable({
  providedIn: 'root'
})

export class OverviewServices {
  private http: any;
  private API_LIST: any;

  constructor(private Http: HttpService) {
    this.http = Http;
    this.API_LIST = {
      GET_DEVICE_FAULT_RATE: `http://${this.http.currentHost}:8080/device/deviceDefectRecord/getDeviceFaultRate`
    };
  }

  public getDeviceFaultRate(type): Observable<any> {
    return this.http.get(this.API_LIST.GET_DEVICE_FAULT_RATE + `?type=${type}`);
  }

}
